package com.ocean.aws.config;

import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.plugin.java.JavaPlugin;

public final class PluginConfig {

	public final boolean compress;

	public final boolean verbose;

	public final boolean huskSyncEnabled;
	public final boolean huskSyncPrefer;

	// Redis skin-node relay
	public final boolean skinRelayEnabled;
	public final String redisUri;
	public final String skinKeyPrefix;
	public final String redisUsername;
	public final String redisPassword;
	public final int skinSyncPeriodSeconds;

	public PluginConfig(JavaPlugin plugin) {
		plugin.saveDefaultConfig();
		FileConfiguration c = plugin.getConfig();
		this.compress = c.getBoolean("strategy.compress", true);
		this.verbose = c.getBoolean("debug.verbose", false);
		this.huskSyncEnabled = c.getBoolean("husksync.enabled", true);
		this.huskSyncPrefer = c.getBoolean("husksync.prefer", true);
		this.skinRelayEnabled = c.getBoolean("skinRelay.enabled", true);
		this.redisUri = c.getString("skinRelay.redisUri", "redis://localhost:6379/0");
		this.skinKeyPrefix = c.getString("skinRelay.keyPrefix", "aw:skin:node:");
		this.redisUsername = c.getString("skinRelay.username", "");
		this.redisPassword = c.getString("skinRelay.password", "");
		this.skinSyncPeriodSeconds = c.getInt("skinRelay.periodicSyncSeconds", 30);
	}
}


